#pragma once

#include <functional>
#include <string>

#include "idataset.h"
#include "networkdefine.h"


typedef std::function<void(const NetworkStatus aStatus, const std::string& aResponse, const std::string& aDescription)>   PWorklistCallback;
typedef std::function<void(const NetworkStatus aStatus, const double aCompletePercent, const std::string& aDescription)>  PStoreCallback;

class INetwork
{
public:
    ~INetwork() = default;

public:
    virtual bool
    EchoRequest(
        const ServerInfo&           aServer
    ) = 0;

    virtual bool
    StoreRequest(
        const ServerInfo&           aServer,
        const std::string&          aDCMFile
    ) = 0;

    virtual bool
    StoreRequest(
        const ServerInfo&           aServer,
        std::shared_ptr<IDataSet>   aDataSet
    ) = 0;

    virtual bool
    WorklistRequest(
        const ServerInfo&           aServer,
        const WorklistInfo&         aWorklist
    ) = 0;

    virtual void
    BindWorklistCallback(
        PWorklistCallback           aCallBack
    ) = 0;

    virtual void
    BindStoreCallback(
        PStoreCallback              aCallBack
    ) = 0;

    virtual bool
    SetTLS(
        const std::string&          aSeedFile,
        const std::string&          aPrivateKey,
        const std::string&          aCertifiFile,
        const std::string&          aPassPhrase,
        const CertificateVerification     aCertify
    ) = 0;

    virtual std::string
    GetOpenSSLVersion()
    = 0;
};
